load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "gcjob",
    srcs = [
        "descriptor_utils.go",
        "gc_job.go",
        "gc_job_utils.go",
        "index_garbage_collection.go",
        "refresh_statuses.go",
        "table_garbage_collection.go",
        "tenant_garbage_collection.go",
        "testutils.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/gcjob",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/config",
        "//pkg/config/zonepb",
        "//pkg/jobs",
        "//pkg/jobs/jobspb",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvclient",
        "//pkg/kv/kvclient/kvcoord",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/protectedts",
        "//pkg/kv/kvserver/protectedts/ptpb",
        "//pkg/multitenant/mtinfopb",
        "//pkg/roachpb",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/spanconfig",
        "//pkg/sql",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/descs",
        "//pkg/sql/isql",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/regions",
        "//pkg/sql/sqlerrors",
        "//pkg/util/admission/admissionpb",
        "//pkg/util/grpcutil",
        "//pkg/util/hlc",
        "//pkg/util/log",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "gcjob_test",
    size = "small",
    srcs = [
        "gc_job_test.go",
        "gc_protected_timestamp_test.go",
        "main_test.go",
        "table_garbage_collection_test.go",
    ],
    embed = [":gcjob"],
    deps = [
        "//pkg/base",
        "//pkg/jobs",
        "//pkg/jobs/jobspb",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvclient/kvcoord",
        "//pkg/kv/kvserver/protectedts",
        "//pkg/kv/kvserver/protectedts/ptpb",
        "//pkg/multitenant/tenantcapabilities",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/spanconfig",
        "//pkg/sql",
        "//pkg/sql/isql",
        "//pkg/testutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/sqlutils",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/randutil",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
    ],
)
